/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package py.com.peluq.model.entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;

/**
 *
 * @author Diego_M
 */
@Embeddable
public class DepositoPK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Column(name = "iddeposito", nullable = false)
    private int iddeposito;
    @Basic(optional = false)
    @NotNull
    @Column(name = "idsucursal", nullable = false)
    private int idsucursal;

    public DepositoPK() {
    }

    public DepositoPK(int iddeposito, int idsucursal) {
        this.iddeposito = iddeposito;
        this.idsucursal = idsucursal;
    }

    public int getIddeposito() {
        return iddeposito;
    }

    public void setIddeposito(int iddeposito) {
        this.iddeposito = iddeposito;
    }

    public int getIdsucursal() {
        return idsucursal;
    }

    public void setIdsucursal(int idsucursal) {
        this.idsucursal = idsucursal;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) iddeposito;
        hash += (int) idsucursal;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof DepositoPK)) {
            return false;
        }
        DepositoPK other = (DepositoPK) object;
        if (this.iddeposito != other.iddeposito) {
            return false;
        }
        if (this.idsucursal != other.idsucursal) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "py.com.peluq.model.entity.DepositoPK[ iddeposito=" + iddeposito + ", idsucursal=" + idsucursal + " ]";
    }
    
}
